#ifndef TESTER_H
#define TESTER_H

#include <QObject>
#include <QVariant>
#include <QDebug>

class Tester : public QObject
{
    Q_OBJECT
    Q_PROPERTY(QString tp READ tp WRITE setTp NOTIFY tpChanged)
public:
    explicit Tester(QObject *parent = 0);

    QString tp() const
    {
        return m_tp;
    }

    void setTp(const QString &val)
    {
        m_tp = val;
        qDebug() << "Tester: setTp" << val;
        emit tpChanged(val);
    }


    void emitTest()
    {
        emit testSignal("signal data");
    }

    Q_INVOKABLE QVariant f1(const QVariant &args);

    void emitNewSignal()
    {
        emit newSignal(127, "i'm string", true);
    }
    
signals:
    void tpChanged(const QVariant &val);
    void testSignal(const QVariant &arg);

    void newSignal(int a, const QString &str, bool ok);
    
public slots:
    void change(const QVariant &v);
    
private:
    QString m_tp;
};

#endif // TESTER_H
